//
//  ICMPartsTopModel.m
//  ICrEAM
//
//  Created by rainimute on 16/11/9.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "ICMPartsTopModel.h"
#import "ICMPropertyManager.h"
#import "ICMMaintenanceAndPartsView.h"
#import "ICMAppointmentMaintenanceAndPartsView.h"

@implementation ICMPartsTopModel

- (void)setupPartsTopModelWithPartsView:(ICMMaintenanceAndPartsView *)partsView{
    
    [ICMPropertyManager setAllValueForEmpty:self];
    
    self.LABOUR_PRICE = partsView.workingUnitPriceView.contentText;
    self.LABOUR_AMOUNT = partsView.workingPriceView.contentText;
    self.REPAIR_PART_AMOUNT = partsView.partsPriceView.contentText;
    self.TOTAL_AMOUNT = partsView.totalPriceView.contentText;
    self.LABOUR_RATE = partsView.workingRatioView.contentText;
    self.PART_RATE = partsView.partsRatioView.contentText;
    self.REAL_TOTAL_AMOUNT = partsView.discountedPrice.contentText;
    self.DELIVERY_DATE = partsView.finishTimeView.contentText;
    //新字段 显示保存用
    self.LABOUR_DISCOUNT_RATE = partsView.workingRatioView.contentText;
    self.PART_DISCOUNT_RATE = partsView.partsRatioView.contentText;
    self.RECEIVE_AMOUNT = partsView.discountedPrice.contentText;
}

- (void)setupPartsTopModelWithAppointmentPartsView:(ICMAppointmentMaintenanceAndPartsView*)partsView{
    [ICMPropertyManager setAllValueForEmpty:self];
    
    self.LABOUR_PRICE = partsView.workingUnitPriceView.contentText;
    self.LABOUR_AMOUNT = partsView.workingPriceView.contentText;
    self.REPAIR_PART_AMOUNT = partsView.partsPriceView.contentText;
    self.TOTAL_AMOUNT = partsView.totalPriceView.contentText;
    self.LABOUR_DISCOUNT_RATE = partsView.workingRatioView.contentText;
    self.PART_DISCOUNT_RATE = partsView.partsRatioView.contentText;
    self.RECEIVE_AMOUNT = partsView.discountedPrice.contentText;

}

@end
